package com.zrc.superframe_net.interceptor

import android.util.Log
import com.blankj.utilcode.util.GsonUtils
import okhttp3.Interceptor
import okhttp3.Response

/**
 * @Author: superman
 * @CreateTime: 6/27/21
 * @Describe:请求返回拦截器(用于调试哦)
 */
class ResultInterceptor :Interceptor{
    override fun intercept(chain: Interceptor.Chain): Response {
        //val response= chain.proceed(chain.request())
        //拦截逻辑 不能放在chain.proceed(chain.request())执行前哦
        //Log.e("ZRC","Result")
        val resp = chain.proceed(chain.request())
        val cookies = resp.headers("Set-Cookie")
        Log.e("ZRC",GsonUtils.toJson(cookies))
        return resp
    }
}